<script language="javascript" src="../js/operadoraLib.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="../js/calendar.js" ></script>
<script type="text/javascript" src="../js/calendar-es.js" language="javascript"></script>
<script type="text/javascript" src="../js/calendar-setup.js" language="javascript"></script>
<style type="text/css">@import url(../css/calendar.css);</style>
<?php
	$idH=$_POST['hotel'];
	$idT=$_POST['thabitacion'];
	$db = new DB();
	$query = "Select h.Nombre, d.Nombre_Destino, t.Nombre From hoteles h, destino d, tipo_habitacion t 
			  Where d.Id_Hotel='{$idH}' And d.Id_Hotel=h.Id_Hotel And t.Id_Tipo='{$idT}'";
	$db->query($query);
	$row=$db->getRow();
	$hotelName=$row[0];
	$destinoName=$row[1];
	$tipoHName=$row[2];
?>
<form name="EditRes" method="post" action="Reservaciones.php">
<table border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
    	<td class="formtitle" colspan="4">Nueva Reservaci&oacute;n</td>
    </tr>
    <tr>
    	<td colspan="4"><hr /></td>
    </tr>
    <tr>
    	<td class="formLabelRes">Titulo Cliente</td>
  		<td width="179" class="formInput">
       	<input type="text" name="TCliente" id="TCliente" size="4" maxlength="5" />
        </td>
      <td class="formLabelRes">Nombre Cliente</td>
      <td class="formInput"><input type="text" name="NCliente" id="NCliente" size="20" /></td>
    </tr>
    <tr>
    	<td class="formLabelRes">Hotel</td>
        <td class="formInput" style="white-space:nowrap;">
			<input type="text" name="HotelesDef" id="HotelesDef" readonly value="<?php echo $hotelName; ?>" />
			<input type="hidden" name="Hoteles" id="Hoteles" value="<?php echo $_POST['hotel']; ?>" />
        </td>
        <td class="formLabelRes">Destino</td>
        <td class="formInput" style="white-space:nowrap;">
        	<input type="text" name="DestinosDef" id="DestinosDef" readonly value="<?php echo $destinoName; ?>" />	
        	<input type="hidden" name="Destinos" id="Destinos" value="<?php echo $_POST['destino'] ?>" />
        </td>
    </tr>
    <tr>
    	<td class="formLabelRes">Tipo de Habitaci&oacute;n</td>
        <td class="formInput" style="white-space:nowrap;">
        	<input type="text" name="tHabitacionesDef" id="tHabitacionesDef" readonly value="<?php echo $tipoHName; ?>" />
        	<input type="hidden" name="tHabitaciones" id="tHabitaciones" value="<?php echo $_POST['thabitacion']; ?>" />
        </td>
        <td class="formLabelRes">&nbsp;</td>
        <td class="formInput">&nbsp;</td>
    </tr> 
    <tr>
    	<td class="formLabelRes">Fecha Reservaci&oacute;n</td>
        <td class="formInput" style="white-space:nowrap;">
        	<input type="text" name="FRes" id="FRes" size="11" readonly value="<?php echo $_POST['fecha']; ?>" />
        </td>
        <td class="formLabelRes">Fecha limite para agencia</td>
        <td class="formInput">
        	<input type="text" name="FLim" id="FLim" size="11" readonly />
            <img style="vertical-align:middle;" class="btnCalendar" src="../images/calendar.jpg" id="FLimtrigger" onMouseOver="this.style.border='1px outset #000000';" onMouseOut="this.style.border='1px outset #CCCCCC';" />
            <script type="text/javascript">
				Calendar.setup(
					{
						inputField : "FLim", // ID of the input field
						ifFormat : "%Y-%m-%d", // the date format
						button : "FLimtrigger" // ID of the button
					}
				);
			</script>
        </td>
    </tr>
    <tr>
    	<td class="formLabelRes">N&deg; Noches</td>
        <td class="formInput"><input size="7" type="text" name="noches" id="noches" readonly value="<?php echo $_POST['noches']; ?>" /></td>
        <td class="formLabelRes">Tipo Pago</td>
        <td class="formInput"><select name="TPago" id="TPago">
        	<?php
				$posPagos= array("Efectivo","Tarjeta","Cheque","Deposito","Otro");
				for($z=0;$z<5;$z++){
					echo "<option value='".$posPagos[$z]."'>".$posPagos[$z]."</option>";
				}
			?>
        	</select>
        </td>
        
    </tr>
    <tr>
    	<td class="formLabelRes">Costo</td>
        <td class="formInput"><input size="7" type="text" name="Costo" id="Costo" /></td>
    	<td class="formLabelRes">Saldo</td>
        <td class="formInput"><input size="7" type="text" name="Saldo" id="Saldo" /></td>
    </tr>
    <tr>
    	<td class="formLabelRes" valign="top">Solicitud Especial</td>
        <td colspan="3" class="formInput">
        	<textarea rows="2" cols="60" name="SolEsp" id="SolEsp"></textarea>
        </td>
    </tr>
    <tr>
    	<td class="formLabelRes">&nbsp;</td>
        <td class="formInput">&nbsp;</td>
        <td class="formLabelRes">Factura</td>
        <td class="formInput"><select name="Factura" id="Factura">
        		<option value="No">No</option>
                <option value="Si">Si</option>
        	</select></td>
    </tr>
    <tr>
    	<td colspan="4" align="center">
        	<br />
            <input type="reset" name="LimpiarBtn" value="Limpiar" />
        	<input type="submit" name="Ingresar" value="Generar" />
        	<input type="button" name="CancelarBtn" value="Cancelar" onclick="parent.location.replace('Disponibilidad.php');"
        </td>
    </tr>
</table>
</form>